//
//  CollectionBase.h
//  CollectionTest
//
//  Created by Dusan Vujosevic on 2013-10-25.
//  Copyright (c) 2013 Suavetech. All rights reserved.
//

#ifndef CollectionTest_CollectionBase_h
#define CollectionTest_CollectionBase_h

#include <stddef.h>

typedef long long elemType;

class CollectionBase
{
public:
	CollectionBase(size_t elemCountHint) {}
	
	// Collection name
	virtual const char* name() const { return "override me"; }
	
	// Initialization, optional
	virtual bool init() { return true; }
	
	// Reset, return to intial (clean) state, mandatory
	virtual void reset() = 0;
	
	// Load the collection, mandatory, timed
	virtual void loadElements(const void* randBytes, size_t elemCount) = 0;
	
	// Random search, mandatory, timed
	virtual bool findElement(elemType elem) = 0;
	
	// Ordered iteration, optional, timed
	virtual bool canIterateOrdered() const { return false; }
	virtual void resetIterateOrdered() { }
	virtual bool nextIterateOrdered(elemType* elem) { return false; }
	
	// Subclasses can print stats, optional, not timed
	virtual void printStats() const {}
};


#endif
